package com.wanbangee.marksystem.controller;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import com.wanbangee.marksystem.service.ScoreClientService;
import com.wanbangee.marksystem.service.SettingClientService;

@RestController
public class TopScoreCompositionController {

	@Autowired
	private SettingClientService settingClientService;   //引入考试流程的对外接口
	@Autowired
	private ScoreClientService scoreClientService;   //引入考试流程的对外接口
	/**
	 * 当前登录人所在学校查询存在英语和语文科目的考试
	 * @param schId
	 * @return
	 */
	@GetMapping("/topScoreComposition/selectExamByTeaId")
	public Map<String, Object> selectExamByTeaId(Integer schId){
		//用来存储提示信息，和状态码，数据
		Map<String, Object> responseMap = new HashMap<String, Object>();
		
		//调用settingClientService中selectExamBySchId方法查询当前登录人所在学校查询存在英语和语文科目的考试
		responseMap = settingClientService.selectExamBySchId(schId);
		
		return responseMap;
	}
	
	/**
	 * 根据所选择的考试查询考试科目为语文和英语的考试
	 * @param examId
	 * @return
	 */
	@GetMapping("/topScoreComposition/selectSubByExamId")
	public Map<String, Object> selectSubByExamId(Integer examId){
		//用来存储提示信息，和状态码，数据
		Map<String, Object> responseMap = new HashMap<String, Object>();
		
		//调用settingClientService中selectExamBySchId方法查询当前登录人所在学校查询存在英语和语文科目的考试
		responseMap = settingClientService.selectMSubjectByExamId(examId);
		
		return responseMap;
	}
	
	/**
	 * 查询高分作文
	 * @param examId
	 * @param examSubId
	 * @return
	 */
	@GetMapping("/topScoreComposition/selectTopScoreComposition")
	public Map<String, Object> selectTopScoreComposition(Integer examId,Integer examSubId){
		//用来存储提示信息，和状态码，数据
		Map<String, Object> responseMap = new HashMap<String, Object>();
		
		//调用scoreClientService中selectTopScoreComposition方法查询当前登录人所在学校查询存在英语和语文科目的考试
		responseMap = scoreClientService.selectTopScoreComposition(examId, examSubId);
		
		return responseMap;
	}
}
